package cfg

import (
	"bytes"
	"encoding/json"
	"io/ioutil"
)

type (
	MAIN_Conf struct {
		Daemon bool `json:"daemon,omitempty"`
	}

	Conf struct {
		MAIN MAIN_Conf `json:"main,omitempty"`
	}
)

func Get_Conf() (*Conf, error) {
	b, err := ioutil.ReadFile(ConfPath)
	if nil != err {
		return nil, err
		panic(err)
	}
	aoc := &Conf{}
	err = json.Unmarshal(bytes.TrimSpace(b), aoc)
	if nil != err {
		panic(err)
		return nil, err
	}
	return aoc, nil
}
